using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;

using System.Reflection;
using Gizmox.WebGUI.Common.Resources;
using Gizmox.WebGUI.Forms;

using System.IO;
using TVC.Layout;

namespace TVC.Modules.Com
{
    /// <summary>
    /// Summary description for CustomWindowPanelControl.
    /// </summary>

    [Serializable()]
    public class CMD : ModuleParent, IHostedApplication
    {
        private TabControl tabControl1;
        private TabPage tbList;
        private TabPage tbDetail;
        private Label label2;
        private TextBox txtDescription;
        private TextBox txtID;
        private Label label1;
        private Label label8;
        private DataGridView dgvList;
        private IContainer components;
        //string _processStatus = "";
        //string _strType = "CMD";
        //string sErr = "";
        private DataGridViewTextBoxColumn colCmdID;
        private DataGridViewTextBoxColumn colDescription;
        private DataGridViewTextBoxColumn colSuspend;
        private DataGridViewTextBoxColumn colCmdGroup;
        private BindingSource bisCMD;
        private Label label11;
        private CustomControl.MultiColumnCombo mcbCmdGroup;
        private ComboBox cboContext;
        private Label label12;
        private ComboBox cboCallingP;
        private CustomControl.MultiColumnCombo mcbDAOG;
        private Label label4;
        private TextBox txtCmdText;
        private Label label5;
        private Button button1;
        private Label label6;
        private TextBox txtTemplate;
        private TextBox txtRange;
        private Label label7;
        private ComboBox cboCONN_ID;
        private Label label9;
        private TextBox textBox1;
        private ExpandableGroupBox gpTemplate;
        private ExpandableGroupBox gbGeneral;
        private ExpandableGroupBox gpParams;
        private TextBox txtR_P6;
        private TextBox txtL_P6;
        private Label label19;
        private TextBox txtP6;
        private TextBox txtP5;
        private Label label18;
        private TextBox txtL_P5;
        private TextBox txtR_P5;
        private TextBox txtP3;
        private Label label17;
        private TextBox txtL_P3;
        private TextBox txtR_P3;
        private TextBox txtR_P4;
        private TextBox txtL_P4;
        private Label label16;
        private TextBox txtP4;
        private TextBox txtP2;
        private Label label15;
        private TextBox txtL_P2;
        private TextBox txtR_P2;
        private TextBox txtR_P1;
        private TextBox txtL_P1;
        private Label label14;
        private Label label13;
        private Label label10;
        private TextBox txtP1;
        private Label label3;
        private Label label22;
        private TextBox txtR_P10;
        private TextBox txtL_P10;
        private TextBox txtP10;
        private TextBox txtP9;
        private TextBox txtL_P9;
        private TextBox txtR_P9;
        private TextBox txtR_P8;
        private TextBox txtL_P8;
        private Label label21;
        private TextBox txtP8;
        private TextBox txtP7;
        private Label label20;
        private TextBox txtL_P7;
        private TextBox txtR_P7;
        private Label label23;
        private Label label24;
        private TextBox txtNotes;
        private Label label25;
        private CheckBox ckbIsRefresh;
        private CheckBox ckbIsSave;
        private CheckBox ckbSuspend;
        GridLayout layout = null;
        public CMD()
        {
            // This call is required by the WebGUI Form Designer.
            InitializeComponent();
            _strType = "CMD";
        }

        /// <summary> 
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        int idAllowEditLanguage = 1;
        int idAddNew = 493;
        int idEdit = 494;
        int idDelete = 497;
        int idclsTransferIn = 498;
        int idclsTransferOut = 499;
        int idPrint = 501;



        protected override void AllowEditLanguage()
        {
            foreach (Control x in tbDetail.Controls)
            {
                if (x is Label)
                {
                    x.DoubleClick += Control_DoubleClick;
                }
                if (x is GroupBox || x is ExpandableGroupBox || x is Panel)
                {
                    x.DoubleClick += Control_DoubleClick;
                    foreach (Control y in x.Controls)
                    {
                        if (y is Label)
                            y.DoubleClick += Control_DoubleClick;
                    }
                }
            }

            ContextMenu menu = new ContextMenu();
            menu.MenuItems.Add(new MenuItem("Edit Language"));
            dgvList.MenuClick += dgvList_MenuClick;
            tabControl1.DoubleClick += tabMain_DoubleClick;
            dgvList.ContextMenu = menu;
        }

        protected override void LoadLanguage(string language)
        {
            foreach (Control x in tbDetail.Controls)
            {
                if (x is Label)
                {
                    clsConfigurarion.GetLabel(this.ToString(), x, language);
                }
                if (x is GroupBox || x is ExpandableGroupBox || x is Panel)
                {
                    clsConfigurarion.GetLabel(this.ToString(), x, language);
                    foreach (Control y in x.Controls)
                    {
                        if (y is Label)
                            clsConfigurarion.GetLabel(this.ToString(), y, language);
                    }
                }
            }
            //clsConfigurarion.GetLabel(this.ToString(), lbUserID, language);
            //clsConfigurarion.GetLabel(this.ToString(), lblDescription, language);
            //clsConfigurarion.GetLabel(this.ToString(), lblLanguage, language);
            //clsConfigurarion.GetLabel(this.ToString(), lblDbDefault, language);
            //clsConfigurarion.GetLabel(this.ToString(), lklRole, language);
            //clsConfigurarion.GetLabel(this.ToString(), lklEmp, language);

            if (this.Parent is HeaderedPanel)
            {
                HeaderedPanel pln = this.Parent as HeaderedPanel;
                _title = clsConfigurarion.GetLabel(this.ToString(), "", null, language);
            }
        }
        public HostedToolBarElement[] GetToolBarElements()
        {
            ArrayList objElements = new ArrayList();
            if (IsPermis(idAddNew))
                objElements.Add(new HostedToolBarButton("Add New", new IconResourceHandle("Add.png"), "C"));
            if (IsPermis(idEdit))
                objElements.Add(new HostedToolBarButton("Edit", new IconResourceHandle("Edit.png"), "A"));
            if (IsPermis(idAddNew) && IsPermis(idEdit))
                objElements.Add(new HostedToolBarButton("Save", new IconResourceHandle("Save.png"), "S"));
            if (IsPermis(idAddNew))
                objElements.Add(new HostedToolBarButton("Copy", new IconResourceHandle("Copy.png"), "O"));
            if (IsPermis(idDelete))
                objElements.Add(new HostedToolBarButton("Delete", new IconResourceHandle("Delete.png"), "X"));
            objElements.Add(new HostedToolBarSeperator());
            if (IsPermis(idclsTransferIn))
                objElements.Add(new HostedToolBarButton("clsTransfer In", new IconResourceHandle("Down.png"), "TI"));
            if (IsPermis(idclsTransferOut))
                objElements.Add(new HostedToolBarButton("clsTransfer Out", new IconResourceHandle("Up.png"), "TO"));
            objElements.Add(new HostedToolBarSeperator());
            if (IsPermis(idPrint))
                objElements.Add(new HostedToolBarButton("Print", new IconResourceHandle("Print.png"), "P"));
            objElements.Add(new HostedToolBarButton("Refresh", new IconResourceHandle("Refresh.png"), "R"));

            objElements.Add(new HostedToolBarButton("Full Screen", new IconResourceHandle("Full.png"), "Full"));

            return (HostedToolBarElement[])objElements.ToArray(typeof(HostedToolBarElement));
        }
        #region Component Designer generated code
        /// <summary> 
        /// Required method for Designer support - do not modify 
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            this.tabControl1 = new Gizmox.WebGUI.Forms.TabControl();
            this.tbList = new Gizmox.WebGUI.Forms.TabPage();
            this.dgvList = new Gizmox.WebGUI.Forms.DataGridView();
            this.colCmdID = new Gizmox.WebGUI.Forms.DataGridViewTextBoxColumn();
            this.colDescription = new Gizmox.WebGUI.Forms.DataGridViewTextBoxColumn();
            this.colSuspend = new Gizmox.WebGUI.Forms.DataGridViewTextBoxColumn();
            this.colCmdGroup = new Gizmox.WebGUI.Forms.DataGridViewTextBoxColumn();
            this.tbDetail = new Gizmox.WebGUI.Forms.TabPage();
            this.gpParams = new Gizmox.WebGUI.Forms.ExpandableGroupBox();
            this.label23 = new Gizmox.WebGUI.Forms.Label();
            this.label22 = new Gizmox.WebGUI.Forms.Label();
            this.txtR_P10 = new Gizmox.WebGUI.Forms.TextBox();
            this.txtL_P10 = new Gizmox.WebGUI.Forms.TextBox();
            this.txtP10 = new Gizmox.WebGUI.Forms.TextBox();
            this.txtP9 = new Gizmox.WebGUI.Forms.TextBox();
            this.txtL_P9 = new Gizmox.WebGUI.Forms.TextBox();
            this.txtR_P9 = new Gizmox.WebGUI.Forms.TextBox();
            this.txtR_P8 = new Gizmox.WebGUI.Forms.TextBox();
            this.txtL_P8 = new Gizmox.WebGUI.Forms.TextBox();
            this.label21 = new Gizmox.WebGUI.Forms.Label();
            this.txtP8 = new Gizmox.WebGUI.Forms.TextBox();
            this.txtP7 = new Gizmox.WebGUI.Forms.TextBox();
            this.label20 = new Gizmox.WebGUI.Forms.Label();
            this.txtL_P7 = new Gizmox.WebGUI.Forms.TextBox();
            this.txtR_P7 = new Gizmox.WebGUI.Forms.TextBox();
            this.txtR_P6 = new Gizmox.WebGUI.Forms.TextBox();
            this.txtL_P6 = new Gizmox.WebGUI.Forms.TextBox();
            this.label19 = new Gizmox.WebGUI.Forms.Label();
            this.txtP6 = new Gizmox.WebGUI.Forms.TextBox();
            this.txtP5 = new Gizmox.WebGUI.Forms.TextBox();
            this.label18 = new Gizmox.WebGUI.Forms.Label();
            this.txtL_P5 = new Gizmox.WebGUI.Forms.TextBox();
            this.txtR_P5 = new Gizmox.WebGUI.Forms.TextBox();
            this.txtP3 = new Gizmox.WebGUI.Forms.TextBox();
            this.label17 = new Gizmox.WebGUI.Forms.Label();
            this.txtL_P3 = new Gizmox.WebGUI.Forms.TextBox();
            this.txtR_P3 = new Gizmox.WebGUI.Forms.TextBox();
            this.txtR_P4 = new Gizmox.WebGUI.Forms.TextBox();
            this.txtL_P4 = new Gizmox.WebGUI.Forms.TextBox();
            this.label16 = new Gizmox.WebGUI.Forms.Label();
            this.txtP4 = new Gizmox.WebGUI.Forms.TextBox();
            this.txtP2 = new Gizmox.WebGUI.Forms.TextBox();
            this.label15 = new Gizmox.WebGUI.Forms.Label();
            this.txtL_P2 = new Gizmox.WebGUI.Forms.TextBox();
            this.txtR_P2 = new Gizmox.WebGUI.Forms.TextBox();
            this.txtR_P1 = new Gizmox.WebGUI.Forms.TextBox();
            this.txtL_P1 = new Gizmox.WebGUI.Forms.TextBox();
            this.label14 = new Gizmox.WebGUI.Forms.Label();
            this.label13 = new Gizmox.WebGUI.Forms.Label();
            this.label10 = new Gizmox.WebGUI.Forms.Label();
            this.txtP1 = new Gizmox.WebGUI.Forms.TextBox();
            this.label3 = new Gizmox.WebGUI.Forms.Label();
            this.gpTemplate = new Gizmox.WebGUI.Forms.ExpandableGroupBox();
            this.ckbIsRefresh = new Gizmox.WebGUI.Forms.CheckBox();
            this.ckbIsSave = new Gizmox.WebGUI.Forms.CheckBox();
            this.label25 = new Gizmox.WebGUI.Forms.Label();
            this.txtCmdText = new Gizmox.WebGUI.Forms.TextBox();
            this.label5 = new Gizmox.WebGUI.Forms.Label();
            this.button1 = new Gizmox.WebGUI.Forms.Button();
            this.txtTemplate = new Gizmox.WebGUI.Forms.TextBox();
            this.cboCONN_ID = new Gizmox.WebGUI.Forms.ComboBox();
            this.label6 = new Gizmox.WebGUI.Forms.Label();
            this.label9 = new Gizmox.WebGUI.Forms.Label();
            this.label7 = new Gizmox.WebGUI.Forms.Label();
            this.textBox1 = new Gizmox.WebGUI.Forms.TextBox();
            this.txtRange = new Gizmox.WebGUI.Forms.TextBox();
            this.gbGeneral = new Gizmox.WebGUI.Forms.ExpandableGroupBox();
            this.ckbSuspend = new Gizmox.WebGUI.Forms.CheckBox();
            this.label24 = new Gizmox.WebGUI.Forms.Label();
            this.txtNotes = new Gizmox.WebGUI.Forms.TextBox();
            this.txtID = new Gizmox.WebGUI.Forms.TextBox();
            this.label1 = new Gizmox.WebGUI.Forms.Label();
            this.txtDescription = new Gizmox.WebGUI.Forms.TextBox();
            this.label2 = new Gizmox.WebGUI.Forms.Label();
            this.label8 = new Gizmox.WebGUI.Forms.Label();
            this.mcbCmdGroup = new TVC.Modules.CustomControl.MultiColumnCombo();
            this.label11 = new Gizmox.WebGUI.Forms.Label();
            this.cboContext = new Gizmox.WebGUI.Forms.ComboBox();
            this.cboCallingP = new Gizmox.WebGUI.Forms.ComboBox();
            this.label12 = new Gizmox.WebGUI.Forms.Label();
            this.label4 = new Gizmox.WebGUI.Forms.Label();
            this.mcbDAOG = new TVC.Modules.CustomControl.MultiColumnCombo();
            this.bisCMD = new Gizmox.WebGUI.Forms.BindingSource(this.components);
            ((System.ComponentModel.ISupportInitialize)(this.tabControl1)).BeginInit();
            this.tabControl1.SuspendLayout();
            this.tbList.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.dgvList)).BeginInit();
            this.tbDetail.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.gpParams)).BeginInit();
            this.gpParams.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.gpTemplate)).BeginInit();
            this.gpTemplate.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.gbGeneral)).BeginInit();
            this.gbGeneral.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.bisCMD)).BeginInit();
            this.SuspendLayout();
            // 
            // tabControl1
            // 
            this.tabControl1.Alignment = Gizmox.WebGUI.Forms.TabAlignment.Bottom;
            this.tabControl1.Appearance = Gizmox.WebGUI.Forms.TabAppearance.Workspace;
            this.tabControl1.Controls.Add(this.tbList);
            this.tabControl1.Controls.Add(this.tbDetail);
            this.tabControl1.Dock = Gizmox.WebGUI.Forms.DockStyle.Fill;
            this.tabControl1.Location = new System.Drawing.Point(3, 3);
            this.tabControl1.Name = "tabControl1";
            this.tabControl1.SelectedIndex = 0;
            this.tabControl1.Size = new System.Drawing.Size(754, 561);
            this.tabControl1.TabIndex = 0;
            // 
            // tbList
            // 
            this.tbList.Controls.Add(this.dgvList);
            this.tbList.Dock = Gizmox.WebGUI.Forms.DockStyle.Fill;
            this.tbList.Location = new System.Drawing.Point(4, 22);
            this.tbList.Name = "tbList";
            this.tbList.Size = new System.Drawing.Size(746, 535);
            this.tbList.TabIndex = 0;
            this.tbList.Text = "List";
            // 
            // dgvList
            // 
            this.dgvList.AllowDrag = false;
            this.dgvList.AllowUserToAddRows = false;
            this.dgvList.AutoGenerateColumns = false;
            this.dgvList.BackgroundColor = System.Drawing.Color.White;
            this.dgvList.BorderStyle = Gizmox.WebGUI.Forms.BorderStyle.FixedSingle;
            this.dgvList.ColumnHeadersHeightSizeMode = Gizmox.WebGUI.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            this.dgvList.Columns.AddRange(new Gizmox.WebGUI.Forms.DataGridViewColumn[] {
            this.colCmdID,
            this.colDescription,
            this.colSuspend,
            this.colCmdGroup});
            this.dgvList.Dock = Gizmox.WebGUI.Forms.DockStyle.Fill;
            this.dgvList.Location = new System.Drawing.Point(0, 0);
            this.dgvList.Name = "dgvList";
            this.dgvList.RowHeadersWidth = 25;
            this.dgvList.RowTemplate.DefaultCellStyle.FormatProvider = new System.Globalization.CultureInfo("en-US");
            this.dgvList.ShowFilterRow = true;
            this.dgvList.Size = new System.Drawing.Size(746, 535);
            this.dgvList.TabIndex = 0;
            this.dgvList.RowHeaderMouseDoubleClick += new Gizmox.WebGUI.Forms.DataGridViewCellMouseEventHandler(this.dgvList_RowHeaderMouseDoubleClick);
            // 
            // colCmdID
            // 
            this.colCmdID.DataPropertyName = "CmdID";
            this.colCmdID.HeaderText = "ID#";
            this.colCmdID.Name = "colCmdID";
            // 
            // colDescription
            // 
            this.colDescription.AutoSizeMode = Gizmox.WebGUI.Forms.DataGridViewAutoSizeColumnMode.Fill;
            this.colDescription.DataPropertyName = "Description";
            this.colDescription.HeaderText = "Description";
            this.colDescription.Name = "colDescription";
            // 
            // colSuspend
            // 
            this.colSuspend.DataPropertyName = "Suspend";
            this.colSuspend.HeaderText = "Suspend";
            this.colSuspend.Name = "colSuspend";
            // 
            // colCmdGroup
            // 
            this.colCmdGroup.DataPropertyName = "CmdGroup";
            this.colCmdGroup.HeaderText = "Group";
            this.colCmdGroup.Name = "colCmdGroup";
            // 
            // tbDetail
            // 
            this.tbDetail.BackColor = System.Drawing.Color.White;
            this.tbDetail.Controls.Add(this.gpParams);
            this.tbDetail.Controls.Add(this.gpTemplate);
            this.tbDetail.Controls.Add(this.gbGeneral);
            this.tbDetail.Dock = Gizmox.WebGUI.Forms.DockStyle.Fill;
            this.tbDetail.Location = new System.Drawing.Point(0, 0);
            this.tbDetail.Name = "tbDetail";
            this.tbDetail.Size = new System.Drawing.Size(746, 535);
            this.tbDetail.TabIndex = 1;
            this.tbDetail.Text = "Detail";
            // 
            // gpParams
            // 
            this.gpParams.BackColor = System.Drawing.SystemColors.Window;
            this.gpParams.Controls.Add(this.label23);
            this.gpParams.Controls.Add(this.label22);
            this.gpParams.Controls.Add(this.txtR_P10);
            this.gpParams.Controls.Add(this.txtL_P10);
            this.gpParams.Controls.Add(this.txtP10);
            this.gpParams.Controls.Add(this.txtP9);
            this.gpParams.Controls.Add(this.txtL_P9);
            this.gpParams.Controls.Add(this.txtR_P9);
            this.gpParams.Controls.Add(this.txtR_P8);
            this.gpParams.Controls.Add(this.txtL_P8);
            this.gpParams.Controls.Add(this.label21);
            this.gpParams.Controls.Add(this.txtP8);
            this.gpParams.Controls.Add(this.txtP7);
            this.gpParams.Controls.Add(this.label20);
            this.gpParams.Controls.Add(this.txtL_P7);
            this.gpParams.Controls.Add(this.txtR_P7);
            this.gpParams.Controls.Add(this.txtR_P6);
            this.gpParams.Controls.Add(this.txtL_P6);
            this.gpParams.Controls.Add(this.label19);
            this.gpParams.Controls.Add(this.txtP6);
            this.gpParams.Controls.Add(this.txtP5);
            this.gpParams.Controls.Add(this.label18);
            this.gpParams.Controls.Add(this.txtL_P5);
            this.gpParams.Controls.Add(this.txtR_P5);
            this.gpParams.Controls.Add(this.txtP3);
            this.gpParams.Controls.Add(this.label17);
            this.gpParams.Controls.Add(this.txtL_P3);
            this.gpParams.Controls.Add(this.txtR_P3);
            this.gpParams.Controls.Add(this.txtR_P4);
            this.gpParams.Controls.Add(this.txtL_P4);
            this.gpParams.Controls.Add(this.label16);
            this.gpParams.Controls.Add(this.txtP4);
            this.gpParams.Controls.Add(this.txtP2);
            this.gpParams.Controls.Add(this.label15);
            this.gpParams.Controls.Add(this.txtL_P2);
            this.gpParams.Controls.Add(this.txtR_P2);
            this.gpParams.Controls.Add(this.txtR_P1);
            this.gpParams.Controls.Add(this.txtL_P1);
            this.gpParams.Controls.Add(this.label14);
            this.gpParams.Controls.Add(this.label13);
            this.gpParams.Controls.Add(this.label10);
            this.gpParams.Controls.Add(this.txtP1);
            this.gpParams.Controls.Add(this.label3);
            this.gpParams.CustomStyle = "X";
            this.gpParams.Dock = Gizmox.WebGUI.Forms.DockStyle.Top;
            this.gpParams.FlatStyle = Gizmox.WebGUI.Forms.FlatStyle.Flat;
            this.gpParams.Location = new System.Drawing.Point(0, 240);
            this.gpParams.Name = "gpParams";
            this.gpParams.Size = new System.Drawing.Size(746, 295);
            this.gpParams.TabIndex = 2;
            this.gpParams.Text = "Parameters";
            this.gpParams.TextImageRelation = Gizmox.WebGUI.Forms.ExpandableGroupBox.HorizontalTextImageRelation.TextBeforeImage;
            // 
            // label23
            // 
            this.label23.AutoSize = true;
            this.label23.Location = new System.Drawing.Point(2, 270);
            this.label23.Name = "label23";
            this.label23.Size = new System.Drawing.Size(61, 13);
            this.label23.TabIndex = 0;
            this.label23.Text = "Param 10";
            // 
            // label22
            // 
            this.label22.AutoSize = true;
            this.label22.Location = new System.Drawing.Point(2, 244);
            this.label22.Name = "label22";
            this.label22.Size = new System.Drawing.Size(61, 13);
            this.label22.TabIndex = 0;
            this.label22.Text = "Param 9";
            // 
            // txtR_P10
            // 
            this.txtR_P10.AllowDrag = false;
            this.txtR_P10.Location = new System.Drawing.Point(461, 267);
            this.txtR_P10.MaxLength = 15;
            this.txtR_P10.Name = "txtR_P10";
            this.txtR_P10.Size = new System.Drawing.Size(278, 20);
            this.txtR_P10.TabIndex = 39;
            // 
            // txtL_P10
            // 
            this.txtL_P10.AllowDrag = false;
            this.txtL_P10.Location = new System.Drawing.Point(268, 267);
            this.txtL_P10.MaxLength = 15;
            this.txtL_P10.Name = "txtL_P10";
            this.txtL_P10.Size = new System.Drawing.Size(187, 20);
            this.txtL_P10.TabIndex = 38;
            // 
            // txtP10
            // 
            this.txtP10.AllowDrag = false;
            this.txtP10.Location = new System.Drawing.Point(57, 267);
            this.txtP10.MaxLength = 15;
            this.txtP10.Name = "txtP10";
            this.txtP10.Size = new System.Drawing.Size(205, 20);
            this.txtP10.TabIndex = 37;
            // 
            // txtP9
            // 
            this.txtP9.AllowDrag = false;
            this.txtP9.Location = new System.Drawing.Point(57, 241);
            this.txtP9.MaxLength = 15;
            this.txtP9.Name = "txtP9";
            this.txtP9.Size = new System.Drawing.Size(205, 20);
            this.txtP9.TabIndex = 34;
            // 
            // txtL_P9
            // 
            this.txtL_P9.AllowDrag = false;
            this.txtL_P9.Location = new System.Drawing.Point(268, 241);
            this.txtL_P9.MaxLength = 15;
            this.txtL_P9.Name = "txtL_P9";
            this.txtL_P9.Size = new System.Drawing.Size(187, 20);
            this.txtL_P9.TabIndex = 35;
            // 
            // txtR_P9
            // 
            this.txtR_P9.AllowDrag = false;
            this.txtR_P9.Location = new System.Drawing.Point(461, 241);
            this.txtR_P9.MaxLength = 15;
            this.txtR_P9.Name = "txtR_P9";
            this.txtR_P9.Size = new System.Drawing.Size(278, 20);
            this.txtR_P9.TabIndex = 36;
            // 
            // txtR_P8
            // 
            this.txtR_P8.AllowDrag = false;
            this.txtR_P8.Location = new System.Drawing.Point(461, 215);
            this.txtR_P8.MaxLength = 15;
            this.txtR_P8.Name = "txtR_P8";
            this.txtR_P8.Size = new System.Drawing.Size(278, 20);
            this.txtR_P8.TabIndex = 33;
            // 
            // txtL_P8
            // 
            this.txtL_P8.AllowDrag = false;
            this.txtL_P8.Location = new System.Drawing.Point(268, 215);
            this.txtL_P8.MaxLength = 15;
            this.txtL_P8.Name = "txtL_P8";
            this.txtL_P8.Size = new System.Drawing.Size(187, 20);
            this.txtL_P8.TabIndex = 32;
            // 
            // label21
            // 
            this.label21.AutoSize = true;
            this.label21.Location = new System.Drawing.Point(2, 219);
            this.label21.Name = "label21";
            this.label21.Size = new System.Drawing.Size(61, 13);
            this.label21.TabIndex = 0;
            this.label21.Text = "Param 8";
            // 
            // txtP8
            // 
            this.txtP8.AllowDrag = false;
            this.txtP8.Location = new System.Drawing.Point(57, 215);
            this.txtP8.MaxLength = 15;
            this.txtP8.Name = "txtP8";
            this.txtP8.Size = new System.Drawing.Size(205, 20);
            this.txtP8.TabIndex = 31;
            // 
            // txtP7
            // 
            this.txtP7.AllowDrag = false;
            this.txtP7.Location = new System.Drawing.Point(57, 189);
            this.txtP7.MaxLength = 15;
            this.txtP7.Name = "txtP7";
            this.txtP7.Size = new System.Drawing.Size(205, 20);
            this.txtP7.TabIndex = 27;
            // 
            // label20
            // 
            this.label20.AutoSize = true;
            this.label20.Location = new System.Drawing.Point(2, 193);
            this.label20.Name = "label20";
            this.label20.Size = new System.Drawing.Size(61, 13);
            this.label20.TabIndex = 0;
            this.label20.Text = "Param 7";
            // 
            // txtL_P7
            // 
            this.txtL_P7.AllowDrag = false;
            this.txtL_P7.Location = new System.Drawing.Point(268, 189);
            this.txtL_P7.MaxLength = 15;
            this.txtL_P7.Name = "txtL_P7";
            this.txtL_P7.Size = new System.Drawing.Size(187, 20);
            this.txtL_P7.TabIndex = 28;
            // 
            // txtR_P7
            // 
            this.txtR_P7.AllowDrag = false;
            this.txtR_P7.Location = new System.Drawing.Point(461, 189);
            this.txtR_P7.MaxLength = 15;
            this.txtR_P7.Name = "txtR_P7";
            this.txtR_P7.Size = new System.Drawing.Size(278, 20);
            this.txtR_P7.TabIndex = 29;
            // 
            // txtR_P6
            // 
            this.txtR_P6.AllowDrag = false;
            this.txtR_P6.Location = new System.Drawing.Point(461, 163);
            this.txtR_P6.MaxLength = 15;
            this.txtR_P6.Name = "txtR_P6";
            this.txtR_P6.Size = new System.Drawing.Size(278, 20);
            this.txtR_P6.TabIndex = 26;
            // 
            // txtL_P6
            // 
            this.txtL_P6.AllowDrag = false;
            this.txtL_P6.Location = new System.Drawing.Point(268, 163);
            this.txtL_P6.MaxLength = 15;
            this.txtL_P6.Name = "txtL_P6";
            this.txtL_P6.Size = new System.Drawing.Size(187, 20);
            this.txtL_P6.TabIndex = 25;
            // 
            // label19
            // 
            this.label19.AutoSize = true;
            this.label19.Location = new System.Drawing.Point(2, 167);
            this.label19.Name = "label19";
            this.label19.Size = new System.Drawing.Size(61, 13);
            this.label19.TabIndex = 0;
            this.label19.Text = "Param 6";
            // 
            // txtP6
            // 
            this.txtP6.AllowDrag = false;
            this.txtP6.Location = new System.Drawing.Point(57, 163);
            this.txtP6.MaxLength = 15;
            this.txtP6.Name = "txtP6";
            this.txtP6.Size = new System.Drawing.Size(205, 20);
            this.txtP6.TabIndex = 24;
            // 
            // txtP5
            // 
            this.txtP5.AllowDrag = false;
            this.txtP5.Location = new System.Drawing.Point(57, 137);
            this.txtP5.MaxLength = 15;
            this.txtP5.Name = "txtP5";
            this.txtP5.Size = new System.Drawing.Size(205, 20);
            this.txtP5.TabIndex = 21;
            // 
            // label18
            // 
            this.label18.AutoSize = true;
            this.label18.Location = new System.Drawing.Point(2, 140);
            this.label18.Name = "label18";
            this.label18.Size = new System.Drawing.Size(61, 13);
            this.label18.TabIndex = 0;
            this.label18.Text = "Param 5";
            // 
            // txtL_P5
            // 
            this.txtL_P5.AllowDrag = false;
            this.txtL_P5.Location = new System.Drawing.Point(268, 137);
            this.txtL_P5.MaxLength = 15;
            this.txtL_P5.Name = "txtL_P5";
            this.txtL_P5.Size = new System.Drawing.Size(187, 20);
            this.txtL_P5.TabIndex = 22;
            // 
            // txtR_P5
            // 
            this.txtR_P5.AllowDrag = false;
            this.txtR_P5.Location = new System.Drawing.Point(461, 137);
            this.txtR_P5.MaxLength = 15;
            this.txtR_P5.Name = "txtR_P5";
            this.txtR_P5.Size = new System.Drawing.Size(278, 20);
            this.txtR_P5.TabIndex = 23;
            // 
            // txtP3
            // 
            this.txtP3.AllowDrag = false;
            this.txtP3.Location = new System.Drawing.Point(57, 85);
            this.txtP3.MaxLength = 15;
            this.txtP3.Name = "txtP3";
            this.txtP3.Size = new System.Drawing.Size(205, 20);
            this.txtP3.TabIndex = 15;
            // 
            // label17
            // 
            this.label17.AutoSize = true;
            this.label17.Location = new System.Drawing.Point(2, 89);
            this.label17.Name = "label17";
            this.label17.Size = new System.Drawing.Size(61, 13);
            this.label17.TabIndex = 0;
            this.label17.Text = "Param 3";
            // 
            // txtL_P3
            // 
            this.txtL_P3.AllowDrag = false;
            this.txtL_P3.Location = new System.Drawing.Point(268, 85);
            this.txtL_P3.MaxLength = 15;
            this.txtL_P3.Name = "txtL_P3";
            this.txtL_P3.Size = new System.Drawing.Size(187, 20);
            this.txtL_P3.TabIndex = 16;
            // 
            // txtR_P3
            // 
            this.txtR_P3.AllowDrag = false;
            this.txtR_P3.Location = new System.Drawing.Point(461, 85);
            this.txtR_P3.MaxLength = 15;
            this.txtR_P3.Name = "txtR_P3";
            this.txtR_P3.Size = new System.Drawing.Size(278, 20);
            this.txtR_P3.TabIndex = 17;
            // 
            // txtR_P4
            // 
            this.txtR_P4.AllowDrag = false;
            this.txtR_P4.Location = new System.Drawing.Point(461, 111);
            this.txtR_P4.MaxLength = 15;
            this.txtR_P4.Name = "txtR_P4";
            this.txtR_P4.Size = new System.Drawing.Size(278, 20);
            this.txtR_P4.TabIndex = 20;
            // 
            // txtL_P4
            // 
            this.txtL_P4.AllowDrag = false;
            this.txtL_P4.Location = new System.Drawing.Point(268, 111);
            this.txtL_P4.MaxLength = 15;
            this.txtL_P4.Name = "txtL_P4";
            this.txtL_P4.Size = new System.Drawing.Size(187, 20);
            this.txtL_P4.TabIndex = 19;
            // 
            // label16
            // 
            this.label16.AutoSize = true;
            this.label16.Location = new System.Drawing.Point(2, 115);
            this.label16.Name = "label16";
            this.label16.Size = new System.Drawing.Size(61, 13);
            this.label16.TabIndex = 0;
            this.label16.Text = "Param 4";
            // 
            // txtP4
            // 
            this.txtP4.AllowDrag = false;
            this.txtP4.Location = new System.Drawing.Point(57, 111);
            this.txtP4.MaxLength = 15;
            this.txtP4.Name = "txtP4";
            this.txtP4.Size = new System.Drawing.Size(205, 20);
            this.txtP4.TabIndex = 18;
            // 
            // txtP2
            // 
            this.txtP2.AllowDrag = false;
            this.txtP2.Location = new System.Drawing.Point(57, 59);
            this.txtP2.MaxLength = 15;
            this.txtP2.Name = "txtP2";
            this.txtP2.Size = new System.Drawing.Size(205, 20);
            this.txtP2.TabIndex = 12;
            // 
            // label15
            // 
            this.label15.AutoSize = true;
            this.label15.Location = new System.Drawing.Point(2, 63);
            this.label15.Name = "label15";
            this.label15.Size = new System.Drawing.Size(61, 13);
            this.label15.TabIndex = 0;
            this.label15.Text = "Param 2";
            // 
            // txtL_P2
            // 
            this.txtL_P2.AllowDrag = false;
            this.txtL_P2.Location = new System.Drawing.Point(268, 59);
            this.txtL_P2.MaxLength = 15;
            this.txtL_P2.Name = "txtL_P2";
            this.txtL_P2.Size = new System.Drawing.Size(187, 20);
            this.txtL_P2.TabIndex = 13;
            // 
            // txtR_P2
            // 
            this.txtR_P2.AllowDrag = false;
            this.txtR_P2.Location = new System.Drawing.Point(461, 59);
            this.txtR_P2.MaxLength = 15;
            this.txtR_P2.Name = "txtR_P2";
            this.txtR_P2.Size = new System.Drawing.Size(278, 20);
            this.txtR_P2.TabIndex = 14;
            // 
            // txtR_P1
            // 
            this.txtR_P1.AllowDrag = false;
            this.txtR_P1.Location = new System.Drawing.Point(461, 33);
            this.txtR_P1.MaxLength = 15;
            this.txtR_P1.Name = "txtR_P1";
            this.txtR_P1.Size = new System.Drawing.Size(278, 20);
            this.txtR_P1.TabIndex = 11;
            // 
            // txtL_P1
            // 
            this.txtL_P1.AllowDrag = false;
            this.txtL_P1.Location = new System.Drawing.Point(268, 33);
            this.txtL_P1.MaxLength = 15;
            this.txtL_P1.Name = "txtL_P1";
            this.txtL_P1.Size = new System.Drawing.Size(187, 20);
            this.txtL_P1.TabIndex = 10;
            // 
            // label14
            // 
            this.label14.AutoSize = true;
            this.label14.Location = new System.Drawing.Point(2, 37);
            this.label14.Name = "label14";
            this.label14.Size = new System.Drawing.Size(61, 13);
            this.label14.TabIndex = 0;
            this.label14.Text = "Param 1";
            // 
            // label13
            // 
            this.label13.AutoSize = true;
            this.label13.Location = new System.Drawing.Point(573, 17);
            this.label13.Name = "label13";
            this.label13.Size = new System.Drawing.Size(61, 13);
            this.label13.TabIndex = 0;
            this.label13.Text = "Validated ";
            // 
            // label10
            // 
            this.label10.AutoSize = true;
            this.label10.Location = new System.Drawing.Point(341, 17);
            this.label10.Name = "label10";
            this.label10.Size = new System.Drawing.Size(61, 13);
            this.label10.TabIndex = 0;
            this.label10.Text = "Lookup";
            // 
            // txtP1
            // 
            this.txtP1.AllowDrag = false;
            this.txtP1.Location = new System.Drawing.Point(57, 33);
            this.txtP1.MaxLength = 15;
            this.txtP1.Name = "txtP1";
            this.txtP1.Size = new System.Drawing.Size(205, 20);
            this.txtP1.TabIndex = 9;
            // 
            // label3
            // 
            this.label3.AutoSize = true;
            this.label3.Location = new System.Drawing.Point(129, 17);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(61, 13);
            this.label3.TabIndex = 0;
            this.label3.Text = "Description";
            // 
            // gpTemplate
            // 
            this.gpTemplate.BackColor = System.Drawing.SystemColors.Window;
            this.gpTemplate.Controls.Add(this.ckbIsRefresh);
            this.gpTemplate.Controls.Add(this.ckbIsSave);
            this.gpTemplate.Controls.Add(this.label25);
            this.gpTemplate.Controls.Add(this.txtCmdText);
            this.gpTemplate.Controls.Add(this.label5);
            this.gpTemplate.Controls.Add(this.button1);
            this.gpTemplate.Controls.Add(this.txtTemplate);
            this.gpTemplate.Controls.Add(this.cboCONN_ID);
            this.gpTemplate.Controls.Add(this.label6);
            this.gpTemplate.Controls.Add(this.label9);
            this.gpTemplate.Controls.Add(this.label7);
            this.gpTemplate.Controls.Add(this.textBox1);
            this.gpTemplate.Controls.Add(this.txtRange);
            this.gpTemplate.CustomStyle = "X";
            this.gpTemplate.Dock = Gizmox.WebGUI.Forms.DockStyle.Top;
            this.gpTemplate.FlatStyle = Gizmox.WebGUI.Forms.FlatStyle.Flat;
            this.gpTemplate.Location = new System.Drawing.Point(0, 102);
            this.gpTemplate.Name = "gpTemplate";
            this.gpTemplate.Size = new System.Drawing.Size(746, 138);
            this.gpTemplate.TabIndex = 1;
            this.gpTemplate.Text = "Command and Template";
            this.gpTemplate.TextImageRelation = Gizmox.WebGUI.Forms.ExpandableGroupBox.HorizontalTextImageRelation.TextBeforeImage;
            // 
            // ckbIsRefresh
            // 
            this.ckbIsRefresh.CheckState = Gizmox.WebGUI.Forms.CheckState.Unchecked;
            this.ckbIsRefresh.Location = new System.Drawing.Point(594, 115);
            this.ckbIsRefresh.Name = "ckbIsRefresh";
            this.ckbIsRefresh.Size = new System.Drawing.Size(76, 17);
            this.ckbIsRefresh.TabIndex = 7;
            this.ckbIsRefresh.Text = "Is Refresh";
            // 
            // ckbIsSave
            // 
            this.ckbIsSave.CheckState = Gizmox.WebGUI.Forms.CheckState.Unchecked;
            this.ckbIsSave.Location = new System.Drawing.Point(521, 115);
            this.ckbIsSave.Name = "ckbIsSave";
            this.ckbIsSave.Size = new System.Drawing.Size(62, 17);
            this.ckbIsSave.TabIndex = 6;
            this.ckbIsSave.Text = "Is Save";
            // 
            // label25
            // 
            this.label25.AutoSize = true;
            this.label25.Location = new System.Drawing.Point(63, 117);
            this.label25.Name = "label25";
            this.label25.Size = new System.Drawing.Size(51, 13);
            this.label25.TabIndex = 0;
            this.label25.Text = "CMD_";
            // 
            // txtCmdText
            // 
            this.txtCmdText.AllowDrag = false;
            this.txtCmdText.Location = new System.Drawing.Point(72, 23);
            this.txtCmdText.Multiline = true;
            this.txtCmdText.Name = "txtCmdText";
            this.txtCmdText.Size = new System.Drawing.Size(598, 58);
            this.txtCmdText.TabIndex = 0;
            // 
            // label5
            // 
            this.label5.AutoSize = true;
            this.label5.Location = new System.Drawing.Point(6, 26);
            this.label5.Name = "label5";
            this.label5.Size = new System.Drawing.Size(54, 13);
            this.label5.TabIndex = 0;
            this.label5.Text = "Command";
            // 
            // button1
            // 
            this.button1.Location = new System.Drawing.Point(669, 22);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(71, 59);
            this.button1.TabIndex = 1;
            this.button1.Text = "Dictionary";
            // 
            // txtTemplate
            // 
            this.txtTemplate.AllowDrag = false;
            this.txtTemplate.Location = new System.Drawing.Point(101, 113);
            this.txtTemplate.MaxLength = 15;
            this.txtTemplate.Name = "txtTemplate";
            this.txtTemplate.Size = new System.Drawing.Size(176, 20);
            this.txtTemplate.TabIndex = 2;
            // 
            // cboCONN_ID
            // 
            this.cboCONN_ID.AllowDrag = false;
            this.cboCONN_ID.FormattingEnabled = true;
            this.cboCONN_ID.Location = new System.Drawing.Point(72, 87);
            this.cboCONN_ID.Name = "cboCONN_ID";
            this.cboCONN_ID.Size = new System.Drawing.Size(85, 21);
            this.cboCONN_ID.TabIndex = 1;
            // 
            // label6
            // 
            this.label6.AutoSize = true;
            this.label6.Location = new System.Drawing.Point(7, 117);
            this.label6.Name = "label6";
            this.label6.Size = new System.Drawing.Size(51, 13);
            this.label6.TabIndex = 0;
            this.label6.Text = "Template :";
            // 
            // label9
            // 
            this.label9.AutoSize = true;
            this.label9.Location = new System.Drawing.Point(6, 91);
            this.label9.Name = "label9";
            this.label9.Size = new System.Drawing.Size(61, 13);
            this.label9.TabIndex = 0;
            this.label9.Text = "Connection";
            // 
            // label7
            // 
            this.label7.AutoSize = true;
            this.label7.Location = new System.Drawing.Point(286, 117);
            this.label7.Name = "label7";
            this.label7.Size = new System.Drawing.Size(68, 13);
            this.label7.TabIndex = 0;
            this.label7.Text = "Script Range";
            // 
            // textBox1
            // 
            this.textBox1.AllowDrag = false;
            this.textBox1.Location = new System.Drawing.Point(160, 87);
            this.textBox1.MaxLength = 15;
            this.textBox1.Name = "textBox1";
            this.textBox1.Size = new System.Drawing.Size(510, 20);
            this.textBox1.TabIndex = 0;
            // 
            // txtRange
            // 
            this.txtRange.AllowDrag = false;
            this.txtRange.Location = new System.Drawing.Point(357, 113);
            this.txtRange.MaxLength = 15;
            this.txtRange.Name = "txtRange";
            this.txtRange.Size = new System.Drawing.Size(152, 20);
            this.txtRange.TabIndex = 3;
            // 
            // gbGeneral
            // 
            this.gbGeneral.BackColor = System.Drawing.SystemColors.Window;
            this.gbGeneral.Controls.Add(this.ckbSuspend);
            this.gbGeneral.Controls.Add(this.label24);
            this.gbGeneral.Controls.Add(this.txtNotes);
            this.gbGeneral.Controls.Add(this.txtID);
            this.gbGeneral.Controls.Add(this.label1);
            this.gbGeneral.Controls.Add(this.txtDescription);
            this.gbGeneral.Controls.Add(this.label2);
            this.gbGeneral.Controls.Add(this.label8);
            this.gbGeneral.Controls.Add(this.mcbCmdGroup);
            this.gbGeneral.Controls.Add(this.label11);
            this.gbGeneral.Controls.Add(this.cboContext);
            this.gbGeneral.Controls.Add(this.cboCallingP);
            this.gbGeneral.Controls.Add(this.label12);
            this.gbGeneral.Controls.Add(this.label4);
            this.gbGeneral.Controls.Add(this.mcbDAOG);
            this.gbGeneral.CustomStyle = "X";
            this.gbGeneral.Dock = Gizmox.WebGUI.Forms.DockStyle.Top;
            this.gbGeneral.FlatStyle = Gizmox.WebGUI.Forms.FlatStyle.Flat;
            this.gbGeneral.Location = new System.Drawing.Point(0, 0);
            this.gbGeneral.Name = "gbGeneral";
            this.gbGeneral.Size = new System.Drawing.Size(746, 102);
            this.gbGeneral.TabIndex = 0;
            this.gbGeneral.Text = "General";
            this.gbGeneral.TextImageRelation = Gizmox.WebGUI.Forms.ExpandableGroupBox.HorizontalTextImageRelation.TextBeforeImage;
            // 
            // ckbSuspend
            // 
            this.ckbSuspend.CheckState = Gizmox.WebGUI.Forms.CheckState.Unchecked;
            this.ckbSuspend.Location = new System.Drawing.Point(676, 25);
            this.ckbSuspend.Name = "ckbSuspend";
            this.ckbSuspend.Size = new System.Drawing.Size(67, 17);
            this.ckbSuspend.TabIndex = 8;
            this.ckbSuspend.Text = "Suspend";
            // 
            // label24
            // 
            this.label24.AutoSize = true;
            this.label24.Location = new System.Drawing.Point(459, 53);
            this.label24.Name = "label24";
            this.label24.Size = new System.Drawing.Size(54, 13);
            this.label24.TabIndex = 0;
            this.label24.Text = "Notes";
            // 
            // txtNotes
            // 
            this.txtNotes.AllowDrag = false;
            this.txtNotes.Location = new System.Drawing.Point(497, 49);
            this.txtNotes.Multiline = true;
            this.txtNotes.Name = "txtNotes";
            this.txtNotes.Size = new System.Drawing.Size(246, 46);
            this.txtNotes.TabIndex = 7;
            // 
            // txtID
            // 
            this.txtID.AllowDrag = false;
            this.txtID.Location = new System.Drawing.Point(73, 23);
            this.txtID.MaxLength = 15;
            this.txtID.Name = "txtID";
            this.txtID.Size = new System.Drawing.Size(130, 20);
            this.txtID.TabIndex = 0;
            // 
            // label1
            // 
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(7, 27);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(32, 13);
            this.label1.TabIndex = 0;
            this.label1.Text = "Code";
            // 
            // txtDescription
            // 
            this.txtDescription.AllowDrag = false;
            this.txtDescription.Location = new System.Drawing.Point(288, 23);
            this.txtDescription.Name = "txtDescription";
            this.txtDescription.Size = new System.Drawing.Size(382, 20);
            this.txtDescription.TabIndex = 1;
            // 
            // label2
            // 
            this.label2.AutoSize = true;
            this.label2.Location = new System.Drawing.Point(212, 27);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(60, 13);
            this.label2.TabIndex = 0;
            this.label2.Text = "Description";
            // 
            // label8
            // 
            this.label8.AutoSize = true;
            this.label8.Location = new System.Drawing.Point(212, 53);
            this.label8.Name = "label5";
            this.label8.Size = new System.Drawing.Size(46, 13);
            this.label8.TabIndex = 0;
            this.label8.Text = "Context";
            // 
            // mcbCmdGroup
            // 
            this.mcbCmdGroup.AllowDrag = false;
            this.mcbCmdGroup.AutoScroll = true;
            this.mcbCmdGroup.AutoValidate = Gizmox.WebGUI.Forms.AutoValidate.EnableAllowFocusChange;
            this.mcbCmdGroup.BackColor = System.Drawing.Color.Transparent;
            this.mcbCmdGroup.Binding = null;
            this.mcbCmdGroup.DisplayField = null;
            this.mcbCmdGroup.DisplayRows = 25;
            this.mcbCmdGroup.Filter = true;
            this.mcbCmdGroup.KeyPressChk = false;
            this.mcbCmdGroup.Layout = null;
            this.mcbCmdGroup.Location = new System.Drawing.Point(73, 49);
            this.mcbCmdGroup.Lookup = null;
            this.mcbCmdGroup.MainForm = null;
            this.mcbCmdGroup.Name = "mcbCmdGroup";
            this.mcbCmdGroup.Size = new System.Drawing.Size(130, 20);
            this.mcbCmdGroup.TabIndex = 2;
            this.mcbCmdGroup.Value = "";
            this.mcbCmdGroup.ValueField = null;
            // 
            // label11
            // 
            this.label11.AutoSize = true;
            this.label11.Location = new System.Drawing.Point(7, 53);
            this.label11.Name = "label11";
            this.label11.Size = new System.Drawing.Size(60, 13);
            this.label11.TabIndex = 0;
            this.label11.Text = "Cmd Group";
            // 
            // cboContext
            // 
            this.cboContext.AllowDrag = false;
            this.cboContext.FormattingEnabled = true;
            this.cboContext.Location = new System.Drawing.Point(289, 49);
            this.cboContext.Name = "cboContext";
            this.cboContext.Size = new System.Drawing.Size(167, 21);
            this.cboContext.TabIndex = 3;
            // 
            // cboCallingP
            // 
            this.cboCallingP.AllowDrag = false;
            this.cboCallingP.FormattingEnabled = true;
            this.cboCallingP.Items.AddRange(new object[] {
            "After Update",
            "Before Update"});
            this.cboCallingP.Location = new System.Drawing.Point(288, 75);
            this.cboCallingP.Name = "cboCallingP";
            this.cboCallingP.Size = new System.Drawing.Size(101, 21);
            this.cboCallingP.TabIndex = 5;
            // 
            // label12
            // 
            this.label12.AutoSize = true;
            this.label12.Location = new System.Drawing.Point(212, 79);
            this.label12.Name = "label12";
            this.label12.Size = new System.Drawing.Size(65, 13);
            this.label12.TabIndex = 0;
            this.label12.Text = "Calling Point";
            // 
            // label4
            // 
            this.label4.AutoSize = true;
            this.label4.Location = new System.Drawing.Point(7, 79);
            this.label4.Name = "label4";
            this.label4.Size = new System.Drawing.Size(62, 13);
            this.label4.TabIndex = 0;
            this.label4.Text = "Data Group";
            // 
            // mcbDAOG
            // 
            this.mcbDAOG.AllowDrag = false;
            this.mcbDAOG.AutoScroll = true;
            this.mcbDAOG.AutoValidate = Gizmox.WebGUI.Forms.AutoValidate.EnableAllowFocusChange;
            this.mcbDAOG.BackColor = System.Drawing.Color.Transparent;
            this.mcbDAOG.Binding = null;
            this.mcbDAOG.DisplayField = null;
            this.mcbDAOG.DisplayRows = 25;
            this.mcbDAOG.Filter = true;
            this.mcbDAOG.KeyPressChk = false;
            this.mcbDAOG.Layout = null;
            this.mcbDAOG.Location = new System.Drawing.Point(72, 75);
            this.mcbDAOG.Lookup = null;
            this.mcbDAOG.MainForm = null;
            this.mcbDAOG.Name = "mcbDAOG";
            this.mcbDAOG.Size = new System.Drawing.Size(130, 20);
            this.mcbDAOG.TabIndex = 4;
            this.mcbDAOG.Value = "";
            this.mcbDAOG.ValueField = null;
            // 
            // bisCMD
            // 
            this.bisCMD.DataSource = typeof(DTO.LIST_CMDInfo);
            // 
            // CMD
            // 
            this.Controls.Add(this.tabControl1);
            this.DockPadding.All = 3;
            this.Padding = new Gizmox.WebGUI.Forms.Padding(3);
            this.Size = new System.Drawing.Size(760, 567);
            this.Load += new System.EventHandler(this.CMD_Load);
            ((System.ComponentModel.ISupportInitialize)(this.tabControl1)).EndInit();
            this.tabControl1.ResumeLayout(false);
            this.tbList.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.dgvList)).EndInit();
            this.tbDetail.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.gpParams)).EndInit();
            this.gpParams.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.gpTemplate)).EndInit();
            this.gpTemplate.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.gbGeneral)).EndInit();
            this.gbGeneral.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.bisCMD)).EndInit();
            this.ResumeLayout(false);

        }
        #endregion


        #region IHostedApplication Members

        public void InitializeApplication()
        {
        }
        //public string GetTitle()
        //{
        //    return _title;
        //}
        public override void AddNew(Control keyC)
        {
            tabControl1.SelectedTab = tbDetail;
            RefeshForm("");
            EnableForm(true);
            _processStatus = "C";
        }

        public void SetObject(object obj)
        {
        }

        public void OnToolBarButtonClick(HostedToolBarButton objButton, EventArgs objEvent)
        {
            Cancel = false;
            try
            {
                sErr = "";
                string strAction = (string)objButton.Tag;

                BUS.LIST_CMDControl ctr = new BUS.LIST_CMDControl();
                switch (strAction)
                {
                    case "C":
                        tabControl1.SelectedTab = tbDetail;
                        RefeshForm("");
                        EnableForm(true);
                        break;
                    case "A":
                        if (dgvList.CurrentCell != null)
                        {
                            DTO.LIST_CMDInfo info = new DTO.LIST_CMDInfo((DataRowView)dgvList.CurrentRow.DataBoundItem);
                            if (txtID.Text != info.CmdID)
                                SetData(info);

                            EnableForm(true);
                            txtID.ReadOnly = true;
                            tabControl1.SelectedTab = tbDetail;
                        }
                        break;
                  
                    case "S":
                        if (layout == null)
                            layout = new GridLayout(MainForm.ServerPath + "Resources\\Layout\\", MainForm.ServerPath + "Documents\\Layout\\" + GetMainForm().PODInfo.USER_ID + "\\", _strType);
                        layout.GetUpDGV(dgvList);
                        layout.SaveLayout();
                        saveRecord(txtID);

                        break;
                    case "O":
                        if (dgvList.CurrentCell != null)
                        {
                            if (txtID.Text == "")
                            {
                                DTO.LIST_CMDInfo info = new DTO.LIST_CMDInfo((DataRowView)dgvList.CurrentRow.DataBoundItem);
                                SetData(info);
                            }
                            EnableForm(true);
                            tabControl1.SelectedTab = tbDetail;
                        }
                        break;
                    case "X":
                        delRecord();

                        break;
                    case "TI":
                        Forms.frmTransferIn frmTI = new Forms.frmTransferIn(_strType, GetMainForm());
                        frmTI.ShowDialog();
                        break;
                    case "TO":
                        Forms.frmTransferOut frmTO = new Forms.frmTransferOut(_strType, GetMainForm());
                        frmTO.Show();
                        break;
                    case "R":
                        RefreshList();
                        break;
                    case "P":
                        if (dgvList.CurrentCell != null)
                        {
                            DTO.LIST_CMDInfo info = new DTO.LIST_CMDInfo((DataRowView)dgvList.CurrentRow.DataBoundItem);
                            DataTable dt = DTO.LIST_CMDInfo.ToDataTable();
                            dt.Rows.Add(info.ToDataRow(dt));
                            DataSet ds = new DataSet();
                            ds.Tables.Add(dt);
                            MainForm amain = GetMainForm();
                            if (amain != null)
                                amain.PrintDataSet(ds, _strType);
                        }
                        break;
                }
                if (Cancel == false)
                    _processStatus = strAction;
                if (sErr == "")
                    ThrowMsg("Command: " + _processStatus);
            }
            catch (Exception ex)
            {
                ThrowMsg(ex.Message + Environment.NewLine + ex.Source);
            }
        }

        public override void delete(Control keyC)
        {
            BUS.LIST_CMDControl ctr = new BUS.LIST_CMDControl();
            if (dgvList.CurrentCell != null)
            {
                DTO.LIST_CMDInfo info = new DTO.LIST_CMDInfo((DataRowView)dgvList.CurrentRow.DataBoundItem);
                if (ctr.IsExist(GetMainForm().DB, info.CmdID))
                {
                    string process = _processStatus;
                    Forms.frmMsg frm = new Forms.frmMsg();
                    frm.FormClosed += (form, args) =>
                    {
                        if (((Gizmox.WebGUI.Forms.Form)form).DialogResult == DialogResult.OK)
                        {
                            ctr.Delete(GetMainForm().DB, info.CmdID);
                            if (sErr == "")
                            {
                                GetMainForm().RemoveRecord(_strType, ((DataRowView)dgvList.CurrentRow.DataBoundItem).Row);
                                EnableForm(false);
                                Rebind();
                                sErr = String.Format(clsConfigurarion.GetErrMsg("E0010", language), info.CmdID);
                            }
                            else
                            {
                                Cancel = true;
                                _processStatus = process;
                            }

                            ThrowMsg(sErr);

                        }
                        else
                        {
                            Cancel = true;
                            _processStatus = process;
                        }

                    };
                    frm.ShowMsg(String.Format(clsConfigurarion.GetErrMsg("E0011", language), info.CmdID));

                }
                else
                {
                    sErr = clsConfigurarion.GetErrMsg("E0002", language);// "Data is not exist";
                    Cancel = true;
                }
            }
        }

        private void RefreshList()
        {
            GetMainForm().LoadDataTable(_strType);
            Rebind();
            if (layout == null)
                layout = new GridLayout(MainForm.ServerPath + "Resources\\Layout\\", String.Format("{0}Documents\\Layout\\{1}\\", MainForm.ServerPath, GetMainForm().PODInfo.USER_ID), _strType);
            layout.ResetLayout();
            layout.SetUpDGV(dgvList);
        }

        public override void saveRecord(Control keyC, bool isDraft = false)
        {
            BUS.LIST_CMDControl ctr = new BUS.LIST_CMDControl();
            if (tabControl1.SelectedTab == tbDetail)
            {
                DTO.LIST_CMDInfo info = GetData();
                if (_processStatus == "A")
                {
                    if (ctr.IsExist(GetMainForm().DB, txtID.Text))
                    {
                        sErr = ctr.Update(info);
                        UpdateRecord(info);
                        sErr = String.Format(clsConfigurarion.GetErrMsg("E0008", language), txtID.Text);
                    }
                    else
                    {
                        Cancel = true;
                        sErr = clsConfigurarion.GetErrMsg("E0002", language);// "Data is not exist";
                    }
                }
                else if (_processStatus == "C" || _processStatus == "O")
                {
                    if (!ctr.IsExist(GetMainForm().DB, txtID.Text))
                    {
                        ctr.Add(info, ref sErr);
                        UpdateRecord(info);
                        sErr = String.Format(clsConfigurarion.GetErrMsg("E0009", language), txtID.Text);
                    }
                    else
                    {
                        Cancel = true;
                        sErr = clsConfigurarion.GetErrMsg("E0007", language);
                    }
                }

                ThrowMsg(sErr);

            }
            else Cancel = true;
        }

        private void UpdateRecord(DTO.LIST_CMDInfo info)
        {
            GetMainForm().GetTable(_strType).BeginLoadData();
            GetMainForm().UpdateRecord(_strType, info.ToDataRow(GetMainForm().GetTable(_strType)).ItemArray, LoadOption.OverwriteChanges);
            GetMainForm().GetTable(_strType).EndLoadData();
            EnableForm(false);
            Rebind();
        }

        private void Rebind()
        {
            bisCMD.DataSource = GetMainForm().GetTable(_strType);
        }

        private void ThrowMsg(string sErr)
        {
            BaseForm x = this.Parent.Parent as BaseForm;
            if (x != null)
            {
                x.SetMsg(sErr);
            }
        }

        private DTO.LIST_CMDInfo GetData()
        {
            DTO.LIST_CMDInfo inf = new DTO.LIST_CMDInfo();
            inf.DTB = GetMainForm().DB;
            inf.CmdID = txtID.Text;
            inf.Description = txtDescription.Text;
            inf.Suspend = ckbSuspend.Checked ? "Y" : "N";
            inf.CmdGroup = mcbCmdGroup.Value;
            inf.Context = cboContext.Text;
            inf.CallingP = cboCallingP.Text;
            inf.DAOG = mcbDAOG.Value;
            inf.CmdText = txtCmdText.Text;
            inf.Template = txtTemplate.Text;
            inf.Range = txtRange.Text;
            inf.CONN_ID = cboCONN_ID.Text;
            inf.IsSave = ckbIsSave.Checked ? "Y" : "N";
            inf.IsRefresh = ckbIsRefresh.Checked ? "Y" : "N";
            inf.P1 = txtP1.Text;
            inf.P2 = txtP2.Text;
            inf.P3 = txtP3.Text;
            inf.P4 = txtP4.Text;
            inf.P5 = txtP5.Text;
            inf.P6 = txtP6.Text;
            inf.P7 = txtP7.Text;
            inf.P8 = txtP8.Text;
            inf.P9 = txtP9.Text;
            inf.P10 = txtP10.Text;
            inf.L_P1 = txtL_P1.Text;
            inf.L_P2 = txtL_P2.Text;
            inf.L_P3 = txtL_P3.Text;
            inf.L_P4 = txtL_P4.Text;
            inf.L_P5 = txtL_P5.Text;
            inf.L_P6 = txtL_P6.Text;
            inf.L_P7 = txtL_P7.Text;
            inf.L_P8 = txtL_P8.Text;
            inf.L_P9 = txtL_P9.Text;
            inf.L_P10 = txtL_P10.Text;
            inf.R_P1 = txtR_P1.Text;
            inf.R_P2 = txtR_P2.Text;
            inf.R_P3 = txtR_P3.Text;
            inf.R_P4 = txtR_P4.Text;
            inf.R_P5 = txtR_P5.Text;
            inf.R_P6 = txtR_P6.Text;
            inf.R_P7 = txtR_P7.Text;
            inf.R_P8 = txtR_P8.Text;
            inf.R_P9 = txtR_P9.Text;
            inf.R_P10 = txtR_P10.Text;
            inf.Notes = txtNotes.Text;

            return inf;

        }

        private void EnableForm(bool p)
        {
            txtID.ReadOnly = !p;
            txtDescription.ReadOnly = !p;
            ckbSuspend.Enabled = p;
            mcbCmdGroup.Enabled = p;
            cboContext.Enabled = p;
            cboCallingP.Enabled = p;
            mcbDAOG.Enabled = p;
            txtCmdText.ReadOnly = !p;
            txtTemplate.ReadOnly = !p;
            txtRange.ReadOnly = !p;
            cboCONN_ID.Enabled = !p;
            ckbIsSave.Enabled = p;
            ckbIsRefresh.Enabled = p;
            txtNotes.ReadOnly = !p;
            txtP1.ReadOnly = !p;
            txtP2.ReadOnly = !p;
            txtP3.ReadOnly = !p;
            txtP4.ReadOnly = !p;
            txtP5.ReadOnly = !p;
            txtP6.ReadOnly = !p;
            txtP7.ReadOnly = !p;
            txtP8.ReadOnly = !p;
            txtP9.ReadOnly = !p;
            txtP10.ReadOnly = !p;
            txtL_P1.ReadOnly = !p;
            txtL_P2.ReadOnly = !p;
            txtL_P3.ReadOnly = !p;
            txtL_P4.ReadOnly = !p;
            txtL_P5.ReadOnly = !p;
            txtL_P6.ReadOnly = !p;
            txtL_P7.ReadOnly = !p;
            txtL_P8.ReadOnly = !p;
            txtL_P9.ReadOnly = !p;
            txtL_P10.ReadOnly = !p;
            txtL_P1.ReadOnly = !p;
            txtL_P1.ReadOnly = !p;
            txtL_P1.ReadOnly = !p;
            txtL_P1.ReadOnly = !p;
            txtL_P1.ReadOnly = !p;
            txtL_P1.ReadOnly = !p;
            txtL_P1.ReadOnly = !p;
            txtL_P1.ReadOnly = !p;
            txtL_P1.ReadOnly = !p;
            txtL_P1.ReadOnly = !p;
        }

        private void SetData(DTO.LIST_CMDInfo info)
        {
            txtID.Text = info.CmdID;
            txtDescription.Text = info.Description;
            ckbSuspend.Checked = info.Suspend == "Y";
            mcbCmdGroup.Value = info.CmdGroup;
            cboContext.Text = info.Context;
            cboCallingP.Text = info.CallingP;
            mcbDAOG.Value = info.DAOG;
            txtCmdText.Text = info.CmdText;
            txtTemplate.Text = info.Template;
            txtRange.Text = info.Range;
            cboCONN_ID.Text = info.CONN_ID;
            ckbIsSave.Checked = info.IsSave == "Y";
            ckbIsRefresh.Checked = info.IsRefresh == "Y";
            txtNotes.Text = info.Notes;
            txtP1.Text = info.P1;
            txtP2.Text = info.P2;
            txtP3.Text = info.P3;
            txtP4.Text = info.P4;
            txtP5.Text = info.P5;
            txtP6.Text = info.P6;
            txtP7.Text = info.P7;
            txtP8.Text = info.P8;
            txtP9.Text = info.P9;
            txtP10.Text = info.P10;
            txtL_P1.Text = info.L_P1;
            txtL_P2.Text = info.L_P2;
            txtL_P3.Text = info.L_P3;
            txtL_P4.Text = info.L_P4;
            txtL_P5.Text = info.L_P5;
            txtL_P6.Text = info.L_P6;
            txtL_P7.Text = info.L_P7;
            txtL_P8.Text = info.L_P8;
            txtL_P9.Text = info.L_P9;
            txtL_P10.Text = info.L_P10;
            txtR_P1.Text = info.R_P1;
            txtR_P2.Text = info.R_P2;
            txtR_P3.Text = info.R_P3;
            txtR_P4.Text = info.R_P4;
            txtR_P5.Text = info.R_P5;
            txtR_P6.Text = info.R_P6;
            txtR_P7.Text = info.R_P7;
            txtR_P8.Text = info.R_P8;
            txtR_P9.Text = info.R_P9;
            txtR_P10.Text = info.R_P10;


        }

        private void RefeshForm(string str)
        {
            txtID.Text = str;
            txtDescription.Text = str;
            ckbSuspend.Text = str;
            mcbCmdGroup.Value = str;
            cboContext.Text = str;
            cboCallingP.Text = str;
            mcbDAOG.Text = str;
            txtCmdText.Text = str;
            txtTemplate.Text = str;
            txtRange.Text = str;
            cboCONN_ID.Text = str;
            ckbIsSave.Text = str;
            ckbIsRefresh.Text = str;
            txtNotes.Text = str;
            txtP1.Text = str;
            txtP2.Text = str;
            txtP3.Text = str;
            txtP4.Text = str;
            txtP5.Text = str;
            txtP6.Text = str;
            txtP7.Text = str;
            txtP8.Text = str;
            txtP9.Text = str;
            txtP10.Text = str;
            txtL_P1.Text = str;
            txtL_P2.Text = str;
            txtL_P3.Text = str;
            txtL_P4.Text = str;
            txtL_P5.Text = str;
            txtL_P6.Text = str;
            txtL_P7.Text = str;
            txtL_P8.Text = str;
            txtL_P9.Text = str;
            txtL_P10.Text = str;
            txtR_P1.Text = str;
            txtR_P2.Text = str;
            txtR_P3.Text = str;
            txtR_P4.Text = str;
            txtR_P5.Text = str;
            txtR_P6.Text = str;
            txtR_P7.Text = str;
            txtR_P8.Text = str;
            txtR_P9.Text = str;
            txtR_P10.Text = str;

        }

        #endregion

        private void CMD_Load(object sender, EventArgs e)
        {
            dgvList.AutoGenerateColumns = false;
            if (!GetMainForm().IsContainsTables(_strType))
                GetMainForm().LoadDataTable(_strType);

            dgvList.DataSource = bisCMD;
            Rebind();

            layout = new GridLayout(MainForm.ServerPath + "Resources\\Layout\\", MainForm.ServerPath + "Documents\\Layout\\" + GetMainForm().PODInfo.USER_ID + "\\", _strType);
            //layout.LoadLayout();
            layout.SetUpDGV(dgvList);
            EnableForm(false);
            if (idAllowEditLanguage >= GetMainForm().Permission.Length || GetMainForm().Permission[idAllowEditLanguage] == 'Y')
                AllowEditLanguage();
        }

        private void dgvList_RowHeaderMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            if (dgvList.CurrentCell != null)
            {
                DTO.LIST_CMDInfo info = new DTO.LIST_CMDInfo((DataRowView)dgvList.CurrentRow.DataBoundItem);
                SetData(info);
                EnableForm(false);
                tabControl1.SelectedTab = tbDetail;
                _processStatus = "V";
            }
        }
        public string GetLanguage()
        {
            return language;
        }

    }
}
